home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)te.d64
/
hangman.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
7KB
|
219 lines
1 POKE53280,0:POKE53281,0
7 PRINT"[147]"TAB(16)"[154] HANGMAN [158]":PRINT
8 REM***BY DAN RUDIAK***ADAPTED BY WHIZ KIDS***
9 PRINTTAB(17)"FOR THE"
10 PRINTTAB(14)"COMMODORE 64":PRINT
11 TI$="000000"
12 PRINT"WHAT IS YOUR FIRST NAME";:INPUTA0$
13 A=INT(TI/5):FORI=1TOA:X=RND(1):NEXTI
19 N$=LEFT$(A0$,1)
20 PRINT"[147]"TAB(16)"HANGMAN":PRINT
22 FORI=1TO10:GETA$:NEXTI
30 PRINT"I THINK OF A WORD AND YOU TRY TO GUESS"
40 PRINT"LETTER BY LETTER WHAT THE WORD IS."
200 PRINT"[129] [162][162][162][162][162][162][162][162][162][162][162][157][157][157][157][157][157][157][157][157][157][157]";
210 PRINT"[161][161][146] [206][206] [194][157][157][157][157][157][157][157][157][157][157][161][161][146] [206][206] [215][157][157][157][157][157][157][157][157][157][157][161][161][146][206][206][157][157][157][157][161][161][146][206]";
220 PRINT"[157][157][157][161][161][146][157][157][161][161][146][157][157][161][161][146][157][157][161][161][146][166][166][166][166][166][163][163][163][163][163][166][166][157][157][157][157][157][157][157][157][157][157][157][157][157][157][166][166][166][166][166][166][166]";
230 PRINT" [166][166][166][166][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][166][166][166][166][166][166][166] [166][166][166][166][166][166]"
240 PRINT"";
250 PRINT"O[157][157][164][194][146][205][157][157][166][163][157][157][157][167][167][157][157][186][186]";
305 M=0:R=0
310 RESTORE:READN:R1=INT(N*RND(1)+1)
340 FOR K=1TOR1:READ A$:NEXTK
350 IF R1<79 AND RND(1)<.3THEN A$=A$+"S"
360 P$=""
370 FOR A=1 TO LEN(A$):P$=P$+"-":NEXTA
390 PRINT"THE WORD IS "P$" "
400 B$="ABCDEFGHIJKLMNOPQRSTUVWXYZ'":U$=""
407 GOTO 420
410 PRINT"THE WORD IS "P$:IF A$=P$ THEN GOSUB7000:GOTO 20
411 R=0:Q=140:GOSUB8000
412 IF TI<140 GOTO 412
413 PRINT" ":PRINT" "
414 PRINT" "
420 PRINT"WHAT IS YOUR GUESS? ";
421 GET G$:PRINT"[157][191][146]";:IFG$=CHR$(13) GOTO 421
422 Q=10:GOSUB8000
423 PRINT"[157][218]";
424 Q=10:GOSUB8000
425 IF G$="" GOTO 421
426 PRINT"[157]"G$:PRINT" "
430 FOR A=1 TO 27
440 IF G$=MID$(B$,A,1) GOTO 480
450 NEXTA
460 PRINT"NOT A VALID":PRINT"CHARACTER!":GOTO 410
480 FOR A=1 TO LEN(U$):IF G$=MID$(U$,A,1) GOTO 510
490 NEXTA:GOTO 540
510 PRINT"YOU HAVE ALREADY"
520 PRINT"USED THAT LETTER!"
530 PRINT"GUESS AGAIN.":GOTO 410
540 U$=U$+G$
545 FOR A=1 TO LEN(A$)
550 IF G$=MID$(A$,A,1) THEN P$=MID$(P$,1,A-1)+G$+MID$(P$,A+1,LEN(P$)):R=1
555 NEXTA
557 IF R=1 GOTO 1000
560 PRINT"WRONG":M=M+1:GOSUB2000:GOTO 410
1000 PRINT"RIGHT"
1001 GOTO 410
2000 ON M GOTO 3100,3200,3300,3400,3500,3600,3700,3900
3100 PRINT"";
3105 PRINT"O[157][157][164][194][146][205][157][157][166][163][157][157][157][167][167][157][157][186][186]";
3115 Q=50:GOSUB8000
3120 PRINT"[157][157][205][145][157][206]";
3130 Q=20:GOSUB8000
3135 PRINT"[157][157][164][207][157] ";
3145 Q=20:GOSUB8000
3150 PRINT"[145][145][145][145][145]O[157][157][167][194][146][205][157][157][157][206][166][206][157][157][157][206][167] [157][157][157][157][186] [186][157] ";
3155 PRINT"[145][145][145][145][145][157][157]O [157][157][157][192][194][146][205] [157][157][157][157] [166][167] [157][157][157][157][167][167] [157][157][157][186][186] [157][157] ";
3160 PRINT"[145][145][145][145][145][157][157]O [157][157][157][198][194][146][205] [157][157][157][157] [166][206] [157][157][157][167] [157][157][186] ";
3170 PRINT"[145][145][145][145][145][157][157]O [157][157][157][164][194][146][205] [157][157][157][157] [166][163] [157][157][157][157][167][167] [157][157][157][186][186] [157][157]" ;
3180 RETURN
3200 PRINT"";
3205 PRINT"O[157][157][164][194][146][205][157][157][166][163][157][157][157][167][167][157][157][186][186]";
3210 GOTO 3120
3300 PRINT"";
3305 PRINT"O[157][157][164][194][146][205][157][157][166][163][157][157][157][167][167][157][157][186][186]";
3310 GOTO 3120
3350 PRINT"O[157][157][186][194][146][205][157][157][166][163][157][157][157][206] [165][157][157][157][157][186] [205][157][163]";
3400 PRINT"";:GOSUB3410
3405 RETURN
3410 PRINT"O[157][157][164][194][146][205][157][157][166][163][157][157][157][167][167][157][157][186][186]";
3416 Q=30:GOSUB8000
3417 PRINT"[145][157][206][157][205]";
3419 Q=15:GOSUB8000
3430 PRINT"[145][145][145][145][157][157]O [157][157][157][164][194][146][205] [157][157][157][166][163] [157][157][157][157][206][167] [157][157][157][205][186] [157]";
3436 Q=5:GOSUB8000
3440 PRINT"[157][157][157][186] ";
3446 Q=10:GOSUB8000
3470 PRINT"[145][145][145][145][157][157]O [157][157][157][164][194][146][205] [157][157][157][166][163] [157][157][157][157][167][167] [157][157][157][186] [205] [157][157]";
3476 Q=5:GOSUB8000
3480 PRINT"[145][157][167][160][157][157][186] [157]"
3490 RETURN
3500 PRINT"";:GOSUB3410
3510 RETURN
3600 PRINT"";
3610 PRINT"O [157][157][157][164][194][146][205] [157][157][157][166][163] [157][157][157][157][167][167] [157][157][157][186][186] [157][157]";
3616 Q=20:GOSUB8000
3620 PRINT"[145][145][145][145][157]O [157][157][157][164][200][146][205] [157][157][157][166][167] [157][157][157][157][167][167] [157][157][157][167][167] [157][157]";
3626 Q=15:GOSUB8000
3630 PRINT"[145][145][145][145][157]O [157][157][157] [217][146][212] [157][157][157][166][212] [157][157][157][157][167][167] [157][157][157][167][167] [157][157]";
3636 Q=15:GOSUB8000
3640 PRINT"[145][145][145][145][157]O [157][157][157][217]"N$"[146][205][157][157][157][217][166][206] [157][157][157][157][167] [165][157][157][157][186] [204] [157][157]";
3646 Q=20:GOSUB8000
3650 PRINT"[145][145][145][157][157][206][157][205]"
3690 RETURN
3700 PRINT"";
3710 PRINT"O [157][157][157][206]"N$"[146][205][157][157][157][205][166][206] [157][157][157][157][167] [165][157][157][157][186] [204] [157][157]";
3715 GOSUB4100
3720 PRINT"[145][145][157][157][165][167][157]";
3725 GOSUB4100
3730 PRINT"[145][145][157][157][157][163] [163][157][157]";
3735 GOSUB4100
3740 PRINT"[145][145][145][157][157][157][163][163][163][163][157][157][157][157][157] [157][157]";
3745 GOSUB4100
3750 PRINT"[145][145][145][145][157][157][157][205][206][157][157][157][157][157] [157][157]";
3755 GOSUB4100
3760 PRINT"[145][145][145][145][157][157][157] [204][186] [157][157][157][157][157] [157][157]";
3765 GOSUB4100
3770 PRINT"[145][145][145][145][145][157][157][165][167][157][157][157][205][206][157]";
3775 GOSUB4100
3780 PRINT"[145][145][145][145][145][157][157][206][205][157]";
3786 Q=35:GOSUB8000
3790 PRINT"[145][145][145][145][145][157][157][164][129][194][164][157]";
3796 Q=35:GOSUB8000
3800 PRINT"[145][145][145][145][145] [157][186][157]";:A0=(null)^(null):PRINT"[145][145][145][145] [157][208][157]";:A0=(null)^(null)
3810 PRINT"[145][145][145][205][157][206][157]";:A0=(null)^(null):PRINT"[145][145][145][145][145][157][157] [157][204]";:A0=(null)^(null):PRINT"[157] [157][207]";
3820 A0=(null)^(null):PRINT"[157][206][157][205]";
3830 RETURN
3900 GOSUB 6100:GOSUB 6000
3920 PRINT" [157][157][157][157][157][205][205][205]";
3925 Q=5:GOSUB8000
3927 PRINT"[157][157][157][145][145] "
3930 FOR Y=2TO3
3940 FOR B=1TOINT(7*RND(1)+1)
3950 FORR0=YTO4:GOSUB4000:GOSUB5000:NEXTR0
3960 FORR0=4TOYSTEP-1:GOSUB4000:GOSUB5000:NEXTR0:NEXTB:NEXTY
3965 R=(null)^(null)^(null):R0=4:A0=6:L0=4:L1=4:GOSUB5000
3968 Q=500*RND(1):GOSUB8000
3969 A0=6:L0=INT(4*RND(1)+1):L1=INT(4*RND(1)+1):GOSUB5000
3970 L0=4:L1=4:GOSUB5000
3971 Q=15:GOSUB8000:FORI=1TOINT(9*RND(1)):GOSUB5000:NEXTI
3972 Q=300:GOSUB8000
3990 PRINT"[147]":GOTO20
4000 A0=INT(7*RND(1)+1):L0=INT(4*RND(1)+1):L1=INT(4*RND(1)+1):RETURN
4100 Q=5:GOSUB8000
4120 RETURN
5000 ON R0 GOTO 5001,5002,5003,5004
5001 PRINT"";:GOTO 5005
5002 PRINT"";:GOTO 5005
5003 PRINT"";:GOTO 5005
5004 PRINT"";
5005 PRINT" [129] [194] [157][157][157][157][157] Q ";
5010 PRINT"[157][157][157][157][157] "N$"[146] [157][157][157][157][157] [166] [157][157][157][157][157] [157][157][157][157][157] [157][157][157][157][157] ";
5020 ON A0 GOTO 5030,5040,5050,5060,5070,5080,5090
5030 PRINT"[157][157][157][157][157][145][145][145][145][145][205][164][164][206]";:GOTO 5100
5040 PRINT"[157][157][157][157][157][145][145][145][145][206][163][163][163]";:GOTO 5100
5050 PRINT"[157][157][157][157][157][145][145][145][145][206][163][163][145][206]";:GOTO 5100
5060 PRINT"[157][157][157][157][157][145][145][145][145][205][206][205][206]";:GOTO 5100
5070 PRINT"[157][157][157][157][157][145][145][145][167][145][206][205][165]";:GOTO 5100
5080 PRINT"[157][157][157][157][145][145][145][217][145][157][217][212][157][212]";:GOTO 5100
5090 PRINT"[157][157][157][157][145][145][145][205][157][145][206][205][157][206]";:GOTO 5100
5100 ON L0 GOTO 5110,5120,5130,5140
5110 PRINT"[157][157][157][157][157][145][145][145][206][204]";:GOTO 5150
5120 PRINT"[157][157][157][157][157][145][145][145][164][186]";:GOTO 5150
5130 PRINT"[157][157][157][157][157][145][145] [205][164]";:GOTO 5150
5140 PRINT"[157][157][157][157][145][157][145] [165][157][204]";:GOTO 5150
5150 ON L1 GOTO 5160,5170,5180,5190
5160 PRINT"[157][157][157][157][157][145][145][145][186][205]";:GOTO 5200
5170 PRINT"[157][157][157][157][157][145][145][145][204][164]";:GOTO 5200
5180 PRINT"[157][157][157][157][157][145][145][204][206] ";:GOTO 5200
5190 PRINT"[157][157][157][157][145][186][157][145][167] [157]";:GOTO 5200
5200 RETURN
6000 PRINT"SO LONG, "A0$
6005 GOSUB6300
6020 PRINT" "
6050 RETURN
6100 PRINT"SORRY -- THE WORD WAS "A$
6105 GOSUB6300
6110 PRINT"THANKS[157][157][157][157][157]ALOT!"
6115 GOSUB6300
6120 RETURN
6215 GOSUB6300
6220 RETURN
6300 Q=160:GOSUB8000
6302 RETURN
7000 PRINT" CONGRATULATIONS[146]"
7005 PRINT:PRINT" YOU GUESSED IT!":PRINT
7010 PRINT"YOU SAVED YOURSELF":PRINT:FORI1=1TO20
7030 Q=15:GOSUB8000
7040 PRINT"[145]FOR THE TIME BEING"
7042 Q=15:GOSUB8000
7043 PRINT"[145] "
7045 NEXTI1
7050 RETURN
8000 TI$="000000"
8010 IF TI<Q GOTO 8010
8020 RETURN
8100 FORI=1TO148:READA$:PRINT"[147]"A$:Q=0:GOSUB8000:NEXTI
9000 DATA 147
9010 DATA"YANK","JERK","KNOCK","YAWN","WELD","SCOWL","WHIRL","HUSK"
9020 DATA"RASP","SWARM","HARM","TEMPT","ASK","CROWD","THWART","SQUAWK"
9030 DATA"SNOW","END","ARC","ARM","ACT","EXCEPT","EXPEND","EXTRACT"
9040 DATA"JUNK","OBSTRUCT","TWANG","ZEPHYR","NICHE","GHOST","JAB","OHM"
9050 DATA"KIND","XYLOPHONE","STYLE","SCHISM","SCHEME","CZAR","CRYPT","ZIP"
9060 DATA"SYMPTOM","TWERP","LEAGUE","CRESCENT","QUIT","SWERVE","GRUB","GROW"
9070 DATA"GNAT","EXEMPT","PSALM","ZEBRA","EXCERPT","INSTINCT","DEPTH","AMP"
9080 DATA"STRENGTH","ANT","NYMPH","SPRINKLING","AWL","ASP","ART","ARK"
9090 DATA"ALP","AXE","URCHIN","AWN","ACE","INKLING","JOWL","KNACK"
9100 DATA"ORCHARD","APE","SCREW","AISLE","YACHT","EMBEZZLE","DUMMY","RHUMBA"
9110 DATA"ASPARAGAS","GNU","WHARF","FOXY","YOGHURT","VOODOO","SOLEMN","DIZZILY"
9120 DATA"GHASTLY","TWILIGHT","STYLUS","SUEDE","ADZ","TYMPANY","TWO","FILCH"
9130 DATA"UGLY","WRY","WAX","SKIING","SCISSORS","TWITCH","VACUUM","PITCH"
9140 DATA"WHY","DRY","STRETCH","TRY","SWIMMING","SWITCH","WATCH","GYPSY"
9150 DATA"GULCH","SKY","DWARF","SIXTH","ELF","FRY","TWELFTH","SPLOTCH"
9160 DATA"PEOPLE","SHREWD","WHO","ARCHAIC","ASH","APT","AND","UNSHRUNK"
9170 DATA"AWE","ALPHA","ESCROW","INFLUX","ISTHMUS","IOTA","JUMPY","KRYPTON"
9180 DATA"OCEANIC","AFT","UNLUCKY","UNSTRUNG","FUZZ","TUX","RYE","AURORA"
9190 DATA"BLITZ","DRUNK","PHYSICS"
10000 PRINT"[147]"